package io.gitee.twoke.generator.engine.impl.persistence.entity;

import io.gitee.twoke.generator.engine.impl.cfg.GenerateEngineConfigurationImpl;
import io.gitee.twoke.generator.engine.impl.generate.DataTable;
import io.gitee.twoke.generator.engine.impl.generate.impl.DataTableQueryImpl;
import io.gitee.twoke.generator.engine.impl.persistence.DataTableDataManager;
import io.gitee.twoke.generator.engine.impl.persistence.entity.data.DataManager;

import java.util.List;

public class DataTableEntityManagerImpl extends AbstractEntityManager<DataTableEntity> implements DataTableEntityManager {

    protected DataTableDataManager dataManager;

    public DataTableEntityManagerImpl(GenerateEngineConfigurationImpl generateEngineConfiguration,
    DataTableDataManager dataManager) {
    super(generateEngineConfiguration);
    this.dataManager = dataManager;
    }

    @Override
    protected DataManager<DataTableEntity> getDataManager() {
        return dataManager;
    }

    @Override
    public long findDataTableCountByQueryCriteria(DataTableQueryImpl dataTableQuery) {
        return dataManager.findDataTableCountByQueryCriteria(dataTableQuery);
    }

    @Override
    public List<DataTable> findDataTablesByQueryCriteria(DataTableQueryImpl dataTableQuery) {
        return dataManager.findDataTablesByQueryCriteria(dataTableQuery);
    }

    @Override
    public long findDataTableCountByTableName(String tableName) {
        return dataManager.findDataTableCountByTableName(tableName);
    }

    @Override
    public DataTable findByTableName(String tableName) {
        return dataManager.findByTableName(tableName);
    }
}